package com.triones.yjj.controller.web;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.yjj.entity.WithdrawalRecordDO;
import com.triones.yjj.entity.bo.PosterConfigBO;
import com.triones.yjj.entity.bo.WithdrawalListParams;
import com.triones.yjj.entity.vo.WithdrawalRecordVO;
import com.triones.yjj.service.WithdrawalRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 提现管理
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/withdrawal")
public class WithdrawalRecordController extends BaseController {

    private final WithdrawalRecordService withdrawalRecordService;

    /**
     * 提现申请
     */
    @PostMapping("/apply")
    public R<Void> withdrawalApply(@Validated @RequestBody WithdrawalRecordDO dto) {
        return toAjax(withdrawalRecordService.withdrawalApply(dto));
    }

    /**
     * 提现明细（分页）
     */
    @GetMapping("/pageList")
    public TableDataInfo<WithdrawalRecordVO> withdrawalPageList(WithdrawalListParams params, PageQuery pageQuery) {
        return withdrawalRecordService.withdrawalPageList(params, pageQuery);
    }

    /**
     * 提现申请
     */
    @PostMapping("/applyEdit")
    public R<Void> withdrawalApplyEdit(@Validated @RequestBody WithdrawalRecordDO dto) {
        return toAjax(withdrawalRecordService.withdrawalApplyEdit(dto));
    }
}
